package com.zzh.partnersys.ai.feign;

import com.zzh.partnersys.ai.entity.request.SaveMessageRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * IM服务Feign客户端
 * 用于回调IM模块完成消息入库
 *
 * @author zzh
 */
@FeignClient(name = "partner-im", path = "/im")
public interface ImServiceFeignClient {

    /**
     * 回调IM模块保存完整消息
     *
     * @param request 消息入库请求
     * @return 是否成功
     */
    @PostMapping("/chat/save-complete-message")
    Boolean saveCompleteMessage(@RequestBody SaveMessageRequest request);

    /**
     * 回调IM模块保存不完整消息
     *
     * @param request 消息入库请求
     * @return 是否成功
     */
    @PostMapping("/chat/save-incomplete-message")
    Boolean saveIncompleteMessage(@RequestBody SaveMessageRequest request);
}

